package pl.qsoft.db.storedProc.statement;

import java.sql.CallableStatement;
import java.util.Map;

import pl.qsoft.db.annotation.StoredProcedureDefinition;

/**
 * Result transformer is responsible for translating statement data into java object. It is up to the implementor how the translation will look like.
 * Class implementing this interface must provide no-arg constructor.
 * <br/>
 * <strong>Remember to close all open resultsets before leaving transform method!</strong>
 * @author Wojciech Kudla
 */
public interface ResultTransformer {
	
	/**
	 * Transforms executed statement data to java object(s)
	 * @param stmt Callable statement
	 * @param procDef Stored procedure definition
	 * @param values Stored procedure parameter values
	 * @return Transformed java object
	 * @throws Exception
	 */
	public Object transform(CallableStatement stmt, StoredProcedureDefinition procDef, Map<Object, Object> values) throws Exception;

}
